package com.act.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import com.act.dao.IAdministrationFeeDao;
import com.act.domain.AdministrationFee;
import com.act.dto.PagerDTO;
import com.act.service.api.IAdministrationFeeService;
import com.act.vo.PagerVo;

/**
* @Desccription:类说明
* @Author: 刘承军
* @E-mail:923050345@qq.com
* @Date:2017年11月13日 下午3:47:49  
*/

@Service
public class AdministrationFeeServiceImpl implements IAdministrationFeeService{

	@Resource
	private IAdministrationFeeDao administrationFeeDao;
	
	@Override
	public void add(AdministrationFee administrationFee) {
		administrationFeeDao.add(administrationFee);
	}

	@Override
	public void update(AdministrationFee administrationFee) {
		administrationFeeDao.update(administrationFee);
	}

	@Override
	public void delete(int id) {
		administrationFeeDao.delete(id);
	}

	@Override
	public AdministrationFee getById(@Param("id")int id) {
		return administrationFeeDao.getById(id);
	}

	@Override
	public PagerVo<Map> getAll(@Param("pagerDTO")PagerDTO pagerDTO) {
		int startIndex = pagerDTO.getStartIndex();
		int endIndex = pagerDTO.getEndIndex();
		int total = administrationFeeDao.getCounts();
		List<Map> lists = administrationFeeDao.getAll(startIndex, endIndex);
		PagerVo<Map> pagerVo = new PagerVo<>(pagerDTO.getPageIndex(),pagerDTO.getPageSize(),total,lists);
		
		return pagerVo;
	}
	
}
